<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>
	<script type="text/javascript">
		const user = {
			name: "John",
			age: 12,
			wife: {
				name: '小樱',
				age: 19
			}
		};

		/*
			proxyUser是代理对象, user是被代理对象
			后面所有的操作都是通过代理对象来操作被代理对象内部属性
		*/
		const proxyUser = new Proxy(user, {
			
		})

		// 通过代理对象获取目标对象中的某个属性值
		console.log(proxyUser.name);
	</script>
</body>

</html>